package createThread.TwoThread;

/**
 * @program: jvm
 * @description
 * @author: tkk fendoukaoziji
 * @create: 2019-04-10 20:07
 **/
public class Thread1 implements Runnable{

    @Override
    public void run() {
        System.out.println("执行线程1");
        Thread t2 = new Thread(new Thread2());
        t2.start();
        try {
            t2.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("线程1执行结束");

    }

    public static void main(String[] args) {
            Thread t1 = new Thread(new Thread1());
            t1.start();

    }
}
